home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2007 February
/
PCWorld_2007-02_cd.bin
/
domacnost a kancelar
/
avedesk
/
AveDesk13.exe
/
Effects
/
Magnification.effectlet
< prev
next >
Wrap
Text File
|
2005-02-15
|
3KB
|
129 lines
<!--
preamble stuff you might say to someone
willing to open this in a text editor.
-->
<?xml version="1.0" encoding="UTF-8"?>
<effectlet>
<info>
<name>Magnification Effect Script</name>
<author>Andreas Verhoeven</author>
<notes><![CDATA[
Makes your icon bigger on mouseover.
]]></notes>
<version>1.0.0</version>
</info>
<settings>
<param name="Debug" type="Boolean" defval="False"/>
</settings>
<preferences>
<preference name="Percentage" type="Integer" defval="33" >
Defines the amount the icon will be magnified to.
</preference>
</preferences>
<images>
</images>
<script engine="vbScript"><![CDATA[
Dim origCX, origCY, origX, origY
Dim magnified
'These routines are the optional ones called by the framework
Sub OnCreate()
magnified = false
'And Reading overwrites them with some previous user changes
Preferences.ReadAll()
End Sub
Sub OnMouseOn()
origX = Desklet.Left
origY = Desklet.Top
origCX = Desklet.Width
origCY = Desklet.Height
magnified = true
Dim nwx, nwy
nwx = Desklet.Width * Percentage.Value / 100
nwy = Desklet.Height * Percentage.Value / 100
Desklet.Move cint(origX - nwx / 2), cint(origY - nwy / 2), origCX + nwx, origCY + nwy
End Sub
Sub RestoreOrig()
if magnified then
Desklet.Move origX, origY, origCX, origCY
magnified = false
end if
End Sub
Sub OnMouseout()
RestoreOrig
End Sub
'Function OnBeforeDraw(IsMouseOn, IsSelected, IsPreview)
'End Function
'Function OnAfterDraw(IsMouseOn, IsSelected, IsPreview)
'End Function
Sub OnSave()
Preferences.SaveAll
End Sub
'Optional. Indicates a preference change
Function OnPreferenceChange(Preference, oldValue, newValue)
End Function
'You can only have 1 Ticker per effectlet
'The OnTimer method is shielded against multiple entrance recursion
Sub OnTimer()
End Sub
'Optional calls that we don't need for this script:
'Sub OnSelect()
'End Sub
'Sub OnDeselect()
'End Sub
'Sub OnShow()
'End Sub
'Sub OnHide()
'End Sub
'Sub OnConfigure()
'the configuration dialog with default UI for
'XML preferences will be shown.
'An additional dialog designer is on its way. It will
'extend the available default preferences of type:
' - slider, checkbox, combobox (builtin, v. 1.1, free on form with v. 1.2)
' - textbox, file browser, favorites URL (builtin and free on form, v. 1.2)
' - Any ocx (external, only free on form, v. 1.2)
'End Sub
Sub OnStartMove()
RestoreOrig
End Sub
Sub OnEndMove()
End Sub
'Sub OnLeftClick()
'RestoreOrig
'End Sub
Sub OnRightClick()
RestoreOrig
End Sub
'Sub OnDestroy
'End Sub
]]></script>
</effectlet>